<template>
  <div>

    <van-nav-bar
        title="特价拼团"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
    />
    <div>
      <h3 style="text-align: right;" >省钱省心，限时拼
        <span style="text-align: left ;">爆款推荐</span>
      </h3>

    </div>
    <van-card
        v-for="item in SpecialAll"
        :key="item.id"
        :price="item.price"
        :origin-price="item.yuanjia"
        :desc="item.jieshao"
        :title="item.name"
        :thumb="item.img"
    >
      <template #tags>
        <van-tag plain type="danger">已拼{{ item.yipin }}</van-tag>
        <van-tag plain type="default">2人团</van-tag>
      </template>
      <template #footer>
        <van-button type="danger" size="small" @click="tejia(item.id)">马上拼</van-button>
      </template>
    </van-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      SpecialAll: []
    }
  },
  methods: {
    tejia(id) {
      this.$router.push({path: '/tejiapintuan', query: { id: id}})
    },
    findSpecialAll() {
      this.axios.get(`http://1.94.221.254:9999/api/qcfw-home/home/special/findSpecialAll`).then(res => {
        this.SpecialAll = res.data.data
      })
    },
    onClickLeft() {
      this.$router.go(-1)
    }
  },
  created() {
    this.findSpecialAll()
  }
}
</script>

<style scoped>

</style>
